﻿using DevExpress.ExpressApp.Blazor.Components.Models;

namespace EasyXaf.EntityDesigner.Editors.CodeEditors;

public class CodeEditorModel : ComponentModelBase
{
    public string Code
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public string Language
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public bool ReadOnly
    {
        get => GetPropertyValue<bool>();
        set => SetPropertyValue(value);
    }

    public int RowCount
    {
        get => GetPropertyValue<int>();
        set => SetPropertyValue(value);
    }

    public event EventHandler<string> CodeChanged;

    public void RaiseCodeChanged(string code)
    {
        CodeChanged?.Invoke(this, code);
    }
}
